load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "authn",
    srcs = [
        "authentication.go",
        "claim.go",
    ],
    importpath = "go.f110.dev/heimdallr/pkg/auth/authn",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/config/configv2",
        "//pkg/database",
        "//pkg/logger",
        "//pkg/rpc",
        "//pkg/rpc/rpcclient",
        "//pkg/session",
        "//vendor/github.com/golang-jwt/jwt",
        "//vendor/go.uber.org/zap",
        "//vendor/golang.org/x/xerrors",
        "//vendor/google.golang.org/grpc",
        "//vendor/google.golang.org/grpc/metadata",
    ],
)

go_test(
    name = "authn_test",
    srcs = [
        "authentication_test.go",
        "util_test.go",
    ],
    embed = [":authn"],
    deps = [
        "//pkg/cert",
        "//pkg/config/configv2",
        "//pkg/database",
        "//pkg/database/memory",
        "//pkg/logger",
        "//pkg/rpc",
        "//pkg/rpc/rpcclient",
        "//pkg/session",
        "//vendor/github.com/golang-jwt/jwt",
        "//vendor/github.com/stretchr/testify/assert",
        "//vendor/github.com/stretchr/testify/require",
        "//vendor/google.golang.org/grpc/metadata",
    ],
)
